package g4p.tests;

import g4p_controls.GEditableTextControl;
import g4p_controls.GEvent;
import g4p_controls.GTextField;
import processing.core.PApplet;

public class DisposeTest extends PApplet {


	GTextField b = null;

	public void setup() {
	  size(400, 300);
	  b = new GTextField(this, 10, 10, 100, 20);
	  frameRate(10);
	}

	public void draw() {
	  background(0);
	}

	public void handleTextEvents(GEditableTextControl textcontrol, GEvent event) { 
	  println("TextFieldEvent");
	}

	public void mousePressed() {
	  if (b != null) {
	    println("dispose");
	    b.dispose();
	    b = null;
	  }
	}

}
